package com.design.strategy.demo;

import java.util.Arrays;

/**
 * Created by yijy on 2018/1/15.
 */
public class Test {

    public void sort(int[] arr){
        for (int i=0;i<arr.length;i++){
            for(int j=i;j<arr.length;j++){
                swap(arr,i,j);
            }
            System.out.println(Arrays.toString(arr));
        }
    }

    public static int[] swap(int[] arr,int i,int j){
        if(arr[i]>arr[j]){
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
        return arr;
    }
}
